import time

from app.modules.apps.container_tomcat import TomcatMultiWarApp, TomcatApp, TomcatScApp
from app.modules.common import network

tomcat = TomcatApp(app_id='euaws:ups',
                   app_name='ups',
                   zone_home_path='/usr/local/app/uc.euaws.area',
                   zone_alias='euaws',
                   port='23080',
                   nas_app_package_path='/usr/local/Beetle/projects/ups/ups_2.0.1.bug0707/20160727-103603',
                   sub_path='/target/ups-ups-2.0.1.bug0707.SNAPSHOT_160727_023614'
                   )
tomcat.stop()
tomcat.uninstall_app()
tomcat.install_app()
tomcat.restart()
print tomcat.is_started()

time.sleep(3)
print tomcat.is_started()
time.sleep(3)
#tomcat.stop()
print tomcat.is_started()
